import {defineStore} from 'pinia';

export const useLeaveStore = defineStore({
  id: 'app-leave',
  state: () => {
    return {
      leaveTimes: 0,
      isLeave: false,
      isLocked: false,
    }
  },
  getters: {
    getLeaveTimes(): number {
      return this.leaveTimes;
    },
    getIsLeave(): boolean {
      return this.isLeave;
    },
    getIsLocked(): boolean {
      return this.isLocked;
    },
  },
  actions: {
    setLeaveTimes(leaveTimes: number) {
      this.leaveTimes = leaveTimes;
    },
    setIsLeave(isLeave: boolean) {
      this.isLeave = isLeave;
    },
    setIsLocked(isLocked: boolean) {
      this.isLocked = isLocked;
    },
  },
});
